package com.ass.elasticsearch.page;

import lombok.Getter;
import lombok.Setter;
import org.dromara.easyes.core.biz.EsPageInfo;

import java.util.List;

@Getter
@Setter
public class EsPageOut<O> {

    private long total;

    private List<O> rows;

    public EsPageOut(long total, List<O> rows) {
        this.total = total;
        this.rows = rows;
    }

    public EsPageOut(EsPageInfo<?> page, List<O> rows) {
        total = page.getTotal();
        this.rows = rows;
    }

    public EsPageOut(EsPageInfo<O> page){
        total = page.getTotal();
        this.rows = page.getList();
    }


}
